﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class openLotteryAdd : AdminpageBase
{
    protected string strtitle = ReadRequest.RequestString("title");
    protected string ctype = ReadRequest.RequestString("t");
    protected long type = ReadRequest.RequestLong("type");
    protected long id = ReadRequest.RequestLong("id");
    protected Model.NewsSite model = new Model.NewsSite();
    protected void Page_Load(object sender, EventArgs e)
    {


        if (!IsPostBack)
        {
        }
    }

    //提交按钮事件
    protected void btn_submit_Click(object sender, EventArgs e)
    {
        save_Newscont();
    }
    private void save_Newscont()
    {
        //获取登录信息
        Model.Manageadmin loginUserInfo_cur = BLL.CMember.ManageadminLoginInfo();
        //没有登录
        if (loginUserInfo_cur == null)
        {
            alertmessageAndGoback("保存失败");
            return;
        }

        Model.LotteryAnnouncement model = new Model.LotteryAnnouncement();
        model.LotteryType = int.Parse(caipiaoType.SelectedValue);
        model.LotteryQS = textQS.Text;
        model.LotteryNo = txtNo.Text;
        model.AddTime = DateTime.Now;
        model.oneCount = decimal.Parse(oneCount.Text.ToString());
        model.oneMoney = decimal.Parse(oneMoney.Text.ToString());
        model.twoCount = decimal.Parse(twoCount.Text.ToString());
        model.twoMoney = decimal.Parse(twoMoney.Text.ToString());
        model.threeCount = decimal.Parse(threeCount.Text.ToString());
        model.threeMoney = decimal.Parse(threeMoney.Text.ToString());
        model.fourCount = decimal.Parse(fourCount.Text.ToString());
        model.fourMoney = decimal.Parse(fourMoney.Text.ToString());
        model.fiveCount = decimal.Parse(fiveCount.Text.ToString());
        model.fiveMoney = decimal.Parse(fiveMoney.Text.ToString());
        model.sixCount = decimal.Parse(sixCount.Text.ToString());
        model.sixMoney = decimal.Parse(sixMoney.Text.ToString());
        model.twoSCount = decimal.Parse(twoSCount.Text.ToString());
        model.twoSMoney = decimal.Parse(twoSMoney.Text.ToString());
        model.openTime = Convert.ToDateTime(control_date.Text);
        model.sumMoney = decimal.Parse(sumMoney.Text);
        model.jiangChi = decimal.Parse(jiangChi.Text);
        if (BLL.LotteryAnnouncement.Add(model) > 0)
        {
            alertmessageAndGo("保存成功！", "/manage/openLotteryNews.aspx");
            return;
        }
        else
        {
            alertmessageAndGoback("保存失败");
            return;
        }
    }
}